// Check if a word is Palindrome
// The word sould read the same as backwaords or forwards.
// I used used code to lowercase string as to avoid captital letters.
//By DreamVB

#include <iostream>
#include <Windows.h>

using namespace std;
using std::cout;
using std::endl;

bool IsPalindrome(char *s){
	char temp[80];
	int x = 0;
	int len = strlen(s);
	int y = (len - 1);
	bool IsGood = true;

	//Copy src into temp
	strcpy(temp, s);

	//Convert to lowercase
	while (x < len){ temp[x] = tolower(temp[x]); x++; }

	x = 0;
	while (x < y){
		//Test start and end of temp
		if (temp[x] != temp[y]){
			//No good exit
			IsGood = false;
			break;
		}
		//INC/DEC counters
		x++;
		y--;
	}
	//Return result.
	return IsGood;
}

int main(int argc, char **anvg){

	cout << IsPalindrome("AMANAPLANACANALPANAMA") << endl; // Returns true
	cout << IsPalindrome("RACECAR") << endl; // Return true
	cout << IsPalindrome("Test") << endl; // Return false

	//Keep console open
	system("pause");
	return 1;
}